package com.fengmi.service.impl;

import com.fengmi.entity.MallGoodsSku;
import com.fengmi.mapper.GoodsSkuMapper;
import com.fengmi.service.GoodsSkuService;
import com.fengmi.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import java.util.List;

@Service
public class GoodsSkuServiceImpl implements GoodsSkuService {

    @Autowired
    private GoodsSkuMapper goodsSkuMapper;

    @Override
    public ResultVO findGoodsSkuBySpuId(String spuId) {
        if (StringUtils.isEmpty(spuId)){
            return new ResultVO(false,"参数不合法");
        }

        List<MallGoodsSku> goodsSkuList = goodsSkuMapper.findGoodsSkuBySpuId(spuId);

        return new ResultVO(true,"success",goodsSkuList);
    }
}
